/**
 * Created with CLion.
 * Description:
 * User: loong
 * Date: 2019-12-08
 * Time: 15:40
 */

#include <wiringPi.h>
#include <stdio.h>
#include "MyVoice.h"
//#include "src/view/MyVoice.h"

int main(int argc, char *argv[]) {
    if (wiringPiSetup() < 0) {
        printf("wiringPi init error!\n");
        return -1;
    }

    //1.初始化
    //1.1设备初始化
    //pcm_device_init("plughw:CARD=Microphone");
    //pcm_device_init("plughw:CARD=Audio");
    //pcm_device_init("plughw:CARD=U0x46d0x825");
    device_init("hw:1,0");
    //1.2语音播放参数初始化,登录讯飞
    //此为树莓派专用
    xfyun_init("56ee43d0");
    //此为Linux专用
    //xfyun_init("5e7472b2");
    //1.3设置声音播放参数初始化
    set_voice_params("xiaoyan", 50, 50, 50, 0);
    //printf("开始合成 ...\n");
    //2.tts
    text_to_speech("你好,,,,,,,我是老板");
    //3.识别
    //char *string = speech_recognition();
    //printf("string:%s\n", string);
    return 0;
}
